﻿
<?php
if(isset($_SESSION) && ($GLOBALS['USER']['level'] >= 2 || $GLOBALS['USER']['admin'])){

?>
   
<h2>Exportation</h2>
   <div class="creeFichier">
      
      <form enctype="multipart/form-data" action="pages/requetes/export_plantes_resultat.php" method="post"> 
      
         <input type="hidden" name="max_file_size" value="2000000">
         
         <div class="subtitle43"> Champs </div>
         
            <div class="expTitle">        
               <span id="lblTax" class="label1Selected">
                  Taxon
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="tax" name="tax" checked="checked" onclick="this.checked=true">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblProp" class="label1">
                  Propriétés Espèce
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="prop" name="prop" onChange="enlightSelection('prop','lblProp')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblAir" class="label1">
                 	Aire géographique
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="air" name="air" onChange="expAirGeoChecked();enlightSelection('air','lblAir')">
               </span>
            </div>
            <div class="expIfAirGeo" id="expIfAirGeo">
               <div class="expTitle">        
                  <span id="lblNver" class="label1">
                     Nom vernaculaire
                  </span>
                  <span class="checkbox1"> 
                     <input type="checkbox"id="nver" name="nver" onChange="enlightSelection('nver','lblNver')">
                  </span>
               </div>
               
               <div class="expTitle">        
                  <span id="lblMibi" class="label1">
                     Milieu Biologique
                  </span>
                  <span class="checkbox1"> 
                     <input type="checkbox" id="mibi" name="mibi" onChange="enlightSelection('mibi','lblMibi')">
                  </span>
               </div>
               
               <div class="expTitle">        
                  <span id="lblTybi" class="label1">
                     Type Biologique
                  </span>
                  <span class="checkbox1"> 
                     <input type="checkbox" id="tybi" name="tybi" onChange="enlightSelection('tybi','lblTybi')">
                  </span>
               </div>
            </div>
            <div class="expTitle">        
               <span id="lblEphe" class="label1">
                  Etat phénologique
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="ephe" name="ephe" onChange="enlightSelection('ephe','lblEphe')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblnbSG" class="label1">
                  Nombre de sachets de graine
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="nbSG" name="nbSG" onChange="enlightSelection('nbSG','lblnbSG')">
               </span>
            </div>
            <div class="expTitle">        
               <span id="lblParc" class="label1">
                  Parcelles
               </span>
               <span class="checkbox1"> 
                  <input type="checkbox" id="parc" name="parc" onChange="enlightSelection('parc','lblParc')">
               </span>
            </div>
            
            <div class="expTitle">
            
            <div class="subtitle43"> Informations Supplémentaires </div>  
            <div class="expTitle">
               <span class="label2">
                  Classification
               </span>
               <span class="input2"> 
                  <select id="clas" name="clas">
                     <option>
                     <?php
                     
                     $query_recup_classif = "SELECT NOMCLASSIFICATION FROM classification";
                     $result_recup_classif = mysql_query($query_recup_classif, $connexion) or logError("RECUP CLASSIFICATION-".$query_recup_classif."-".mysql_error());
                     while ($tab_recup_classif = mysql_fetch_assoc($result_recup_classif)){
                        echo '<option>'.$tab_recup_classif['NOMCLASSIFICATION'];                     
                     }
                     mysql_free_result($result_recup_classif);
                     ?>
                  </select>
               </span>
            </div>
               <span class="submit1">
                  <input type="submit" name="export" value="Exporter">
               </span>
            </div>
         </form>
   </div>
<div class="information">
	<div class="titre">Informations</div>
	<h4>Remarque :</h4>
	<p>Les champs famille, genre et espèce sont obligatoirement sélectionnés.</p>
</div>
<?php

}
else{
		if(isset($_SESSION)){
			if(!isset($_SESSION['user_id'])){ // si l'utilisateur n'est pas connecté
				include("pages/connexion.php");
			}else{ // si l'utilisateur est connecté et qu'il n'a pas accès à la page, c'est qu'il n'a pas le droit d'utilisation nécessaire
				include("pages/401.htm");
			}
		}
	}
?>